//
//  UIBarButtonItem+Extension.swift
//  WeiBo
//
//  Created by qfh on 16/7/9.
//  Copyright © 2016年 qiufuhe. All rights reserved.
//

import UIKit


extension UIBarButtonItem {

    // MARK: - 自定义uibarButtonItem
    convenience init(title: String, target: AnyObject?, action: Selector) {
        
        self.init()
        
        let button = UIButton()
        
        button.addTarget(target, action: action, forControlEvents: .TouchUpInside)
        
        button.setTitleColor(UIColor.grayColor(), forState: .Normal)
        
        button.setTitleColor(UIColor.orangeColor(), forState: .Highlighted)
        
        button.setTitle(title, forState: .Normal)
        
        button.titleLabel?.font = UIFont.systemFontOfSize(14)
        
        button.sizeToFit()
        
        customView = button
    
        
    }

}
